//
//  HuojiangViewController.m
//  A_HandHeldLOL
//
//  Created by Zhao YanBin on 16/1/21.
//  Copyright © 2016年 zhaoyanbin. All rights reserved.
//

#import "HuojiangViewController.h"
#import "AFNModel.h"
#import "FazhanModel.h"

@interface HuojiangViewController ()
@property(nonatomic, retain)NSMutableArray *dataArr;
@end

@implementation HuojiangViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"获奖荣誉";
    UIWebView *wv = [[UIWebView alloc] initWithFrame:self.view.bounds];
    //    wv.backgroundColor = [UIColor magentaColor];
    [self.view addSubview:wv];
    NSString *str1 = @"http://qt.qq.com/php_cgi/lol_mobile/club/varcache_team_info.php?id=";
    NSString *str2 = @"&version=3&plat=ios";
    NSString *str = [NSString stringWithFormat:@"%@%@%@",str1,_detailsid,str2];
    [AFNModel GETWithURL:str completion:^(id result) {
        //        NSArray *arr = result[@"tags"];
        self.dataArr = result[@"tags"];
        NSString *url = [_dataArr lastObject][@"url"];
        NSString *fazhanid = [url substringFromIndex:url.length - 5];
        
        NSString *str3 = @"http://qt.qq.com/php_cgi/lol_mobile/club/varcache_team_article.php?id=";
        NSString *str4 =  @"&version=3&plat=ios&APP_BROWSER_VERSION_CODE=1&ios_version=801&imgmode=auto";
        NSString *fazhanurl = [NSString stringWithFormat:@"%@%@%@", str3,fazhanid,str4];
        [wv loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:fazhanurl]]];
    }];

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
